<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="./../assets/css/combined.css">
	<link rel="shortcut icon" href="./../favicon.ico" />
	<script src="http://www.google.com/jsapi" type="text/javascript"></script>
	<script type="text/javascript">
		var path = './../';
	</script>
	<script src="./../assets/js/combined.js"></script>
	<title>Configuration - General - FuelPHP Documentation</title>
</head>
<body>
	<div id="container">
		<header id="header">
			<div class="table">
				<h1>
					<strong>FuelPHP, a PHP 5.3 Framework</strong>
					Documentation
				</h1>

				<form id="google_search">
					<p>
						<span id="search_clear">&nbsp;</span>
						<input type="submit" name="search_submit" id="search_submit" value="search" />
						<input type="text" value="" id="search_input" name="search_input" />
					</p>
				</form>
			</div>
			<nav>

				<div class="clear"></div>
			</nav>
			<a href="#" id="toc_handle">table of contents</a>
			<div class="clear"></div>
		</header>

		<div id="cse">
			<div id="cse_point"></div>
			<div id="cse_content"></div>
		</div>

		<div id="main">

			<h2>Configuring your application</h2>

			<h3 id="intro">Introduction</h3>
			<p>
				The FuelPHP framework is built with configuration over convention in mind. This results in a highly customizable
				base on which you can start building your application.
			</p>

			<p>
				Configuration files are stored inside the <kbd>app/config</kbd> folder. The application's basic
				configuration is done in <em>app/config/config.php</em>. The loaded configuration can be made
				environment specific, more on this under <a href="environments.html#/env_config">Environments</a>.
			</p>

			<p class="note">
				To overwrite settings from feature specific configs, either create a new file in app/config or copy
				the corresponding file from core/config to app/config.
			</p>

			<h3 id="config">Configuration options</h3>

			<p>
				These are the options that can be defined in the applications basic configuration file, <kbd>app/config/config.php</kbd>.
				When you have just installed FuelPHP, this file is empty. All default values, as defined below, are defined in the
				corresponding file in the <kbd>core/config</kbd> folder. When you want to override a default, add the key to the array
				in your app config file, and modify the value. Alternatively, copy the section from the core file to the app file, and
				modify it.
			</p>

			<p class="note">
				FuelPHP uses "<em>dot-notation</em>" when handling arrays. It is a convenient way of accessing elements of a multi-dimensional
				array. This notation is used in the documenation as well, as it provides an easy to type array reference. For example:
			</p>
			<pre class="php"><code>// when you see "always_load.packages = array()", it is shorthand for:
array("always_load" => array("packages" => array(...) ) );
</code></pre>


			<table class="config">
				<tbody>
					<tr class="header">
						<th style="width:500px;">Key</th>
						<th>Type</th>
						<th>Default</th>
						<th>Description</th>
					</tr>
					<tr>
						<th>base_url</th>
						<td>string</td>
						<td><pre class="php"><code>null</code></pre></td>
						<td>
							The base URL of the application. Can be relative. MUST contain a trailing slash. ('/foo/', 'http://example.com/')
						</td>
					</tr>
					<tr>
						<th>url_suffix</th>
						<td>string</td>
						<td><pre class="php"><code>''</code></pre></td>
						<td>
							Any suffix that needs to be added to URL's generated by Fuel. If the suffix is an extension,
							make sure to include the dot. ('.html')
						</td>
					</tr>
					<tr>
						<th>index_file</th>
						<td>string</td>
						<td><pre class="php"><code>'index.php'</code></pre></td>
						<td>
							The name of the main bootstrap file. Set this to false or remove if you using mod_rewrite.
						</td>
					</tr>
					<tr>
						<th>controller_prefix</th>
						<td>string</td>
						<td><pre class="php"><code>'Controller_'</code></pre></td>
						<td>
							The class prefix used to find controllers when mapping the URI to the controller class name.
							You have to change this if you want your controllers namespaced or in a different folder then
							app/classes/controller.
						</td>
					</tr>
					<tr>
						<th>profiling</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Whether to enable the profiler.
						</td>
					</tr>
					<tr>
						<th>cache_dir</th>
						<td>string</td>
						<td><pre class="php"><code>APPPATH.'cache/'</code></pre></td>
						<td>
							The directory to store cache files in. This directory must be writable.
						</td>
					</tr>
					<tr>
						<th>caching</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Whether to enable file finder caching.
						</td>
					</tr>
					<tr>
						<th>cache_lifetime</th>
						<td>int</td>
						<td><pre class="php"><code>3600</code></pre></td>
						<td>
							The file finder cache lifetime in seconds.
						</td>
					</tr>
					<tr>
						<th>ob_callback</th>
						<td>callback</td>
						<td><pre class="php"><code>null</code></pre></td>
						<td>
							Callback given to ob_start(), set to ob_gzhandler to enable gzip encoding of output.
						</td>
					</tr>
					<tr>
						<td colspan="4">
						</td>
					</tr>
					<tr>
						<th>errors</th>
						<td>array</td>
						<td colspan="2">
							<strong>Array, containing the configuration keys to control behaviour when detecting errors:</strong>
						</td>
					</tr>
					<tr>
						<th>errors.continue_on</th>
						<td>array</td>
						<td><pre class="php"><code>array(
)</code></pre></td>
						<td>
							On which php errors to proceed execution. See <a href="./error.html">Error handling</a>.
						</td>
					</tr>
					<tr>
						<th>errors.throttle</th>
						<td>int</td>
						<td><pre class="php"><code>10</code></pre></td>
						<td>
							How many errors to show before we stop showing them. (prevents out-of-memory errors)
						</td>
					</tr>
					<tr>
						<th>errors.notices</th>
						<td>bool</td>
						<td><pre class="php"><code>true</code></pre></td>
						<td>
							Whether to show notices.
						</td>
					</tr>
					<tr>
						<th>language</th>
						<td>string</td>
						<td><pre class="php"><code>'en'</code></pre></td>
						<td>
							The default application language, used by the <a href="../classes/lang.html">Lang class</a>.
						</td>
					</tr>
					<tr>
						<th>locale</th>
						<td>string</td>
						<td><pre class="php"><code>'en_US'</code></pre></td>
						<td>
							Used for <em>setlocale()</em> required on some php installations, set to <kbd>false</kbd>
							to prevent it from being set.<br />
							<em>The syntax setting for this can differ per OS, Ubuntu for example requires a
							<kbd>.utf8</kbd> (the encoding) suffix.</em>
						</td>
					</tr>
					<tr>
						<th>encoding</th>
						<td>string</td>
						<td><pre class="php"><code>'UTF-8'</code></pre></td>
						<td>
							The application's default character encoding.
						</td>
					</tr>
					<tr>
						<th>server_gmt_offset</th>
						<td>int</td>
						<td><pre class="php"><code>0</code></pre></td>
						<td>
							The offset in seconds the server offset from gmt timestamp when time() is used.<br />
							<em>This is only to correct bad server configuration: <kbd>time()</kbd> should always
							return the number of seconds since January 1 1970 00:00:00 GMT.</em>
						</td>
					</tr>
					<tr>
						<th>default_timezone</th>
						<td>string</td>
						<td><pre class="php"><code>'UTC'</code></pre></td>
						<td>
							The server timezone.
						</td>
					</tr>
					<tr>
						<td colspan="4">
						<p class="note">
							If you set this value, make <strong>ABSOLUTELY</strong> sure that the timezone configured matches the timezone set on your server.
							Since timezone calculations work by converting to GMT, it goes horribly wrong when you have a timezone mismatch. This will cause
							time displays in your application to be incorrect, and cookie/session issues due to incorrect expiry time calculations!
						</p>
						</td>
					</tr>
					<tr>
						<th>log_threshold</th>
						<td>int</td>
						<td><pre class="php"><code>Fuel::L_WARNING</code></pre></td>
						<td>
							The logging threshold. From what level of message to log, or an array of specific message levels that should be logged. <a href="../classes/fuel.html#log_constants">Read about the possible values</a>
						</td>
					</tr>
					<tr>
						<th>log_path</th>
						<td>string</td>
						<td><pre class="php"><code>APPPATH.'logs/'</code></pre></td>
						<td>
							The directory to store the logs in. This directory MUST be writable.
						</td>
					</tr>
					<tr>
						<th>log_date_format</th>
						<td>string</td>
						<td><pre class="php"><code>'Y-m-d H:i:s'</code></pre></td>
						<td>
							The date/time format used in the logs.
						</td>
					</tr>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<tr>
						<th>security</th>
						<td>array</td>
						<td colspan="2">
							<strong>Array, containing the configuration keys to control your application security:</strong>
						</td>
					</tr>
					<tr>
						<th>security.csrf_autoload</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Whether to auto-check the csrf token. <a href="../general/security.html#csrf">Read more about csrf</a>.
						</td>
					</tr>
					<tr>
						<th>security.csrf_token_key</th>
						<td>string</td>
						<td><pre class="php"><code>'fuel_csrf_token'</code></pre></td>
						<td>
							Which $_POST key to fetch when checking the csrf token.
						</td>
					</tr>
					<tr>
						<th>security.csrf_expiration</th>
						<td>int</td>
						<td><pre class="php"><code>0</code></pre></td>
						<td>
							Set the expiration time for the csrf cookie. Anything higher than 0 is the number of seconds in
							which the cookie will expire.
						</td>
					</tr>
					<tr>
						<th>security.token_salt</th>
						<td>string</td>
						<td><pre class="php"><code>'put your salt value here to make the token more secure'</code></pre></td>
						<td>
							A salt to make sure the generated security tokens are not predictable.
						</td>
					</tr>
					<tr>
						<th>security.allow_x_headers</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Allow the Input class to use "X" headers when present, such as HTTP_X_FORWARDED_FOR or HTTP_X_FORWARDED_PROTO.
						</td>
					</tr>
					<tr>
						<th>security.uri_filter</th>
						<td>array</td>
						<td><pre class="php"><code>array('htmlentities')</code></pre></td>
						<td>
							What php functions to use to filter the URI.
						</td>
					</tr>
					<tr>
						<th>security.input_filter</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							What php functions filter the input arrays ($_GET, $_POST and $_COOKIE). Can be set to <em>xxs_clean</em>,
							this may cause a performance hit based on the size of the input.
						</td>
					</tr>
					<tr>
						<th>security.output_filter</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							What php functions filter the variables set to a view. Can be set to <em>xxs_clean</em>,
							this may cause a performance hit based on the size of the variables.
						</td>
					</tr>
					<tr>
						<th>security.auto_filter_output</th>
						<td>bool</td>
						<td><pre class="php"><code>true</code></pre></td>
						<td>
							Whether to automatically encode (htmlentities) view data.
						</td>
					</tr>
					<tr>
						<th>security.whitelisted_classes</th>
						<td>array()</td>
						<td><pre class="php"><code>array(
'stdClass',
'Fuel\\Core\\View',
'Fuel\\Core\\ViewModel',
'Closure'
)</code></pre></td>
						<td>
							With output encoding switched on all objects passed will be converted to strings or throw exceptions
							unless they are instances of the classes in this array.
						</td>
					</tr>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<tr>
						<th>cookie</th>
						<td>array</td>
						<td colspan="2">
							<strong>Array, containing the configuration keys define the global cookie settings:</strong>
						</td>
					</tr>
					<tr>
						<th>cookie.expiration</th>
						<td>int</td>
						<td><pre class="php"><code>0</code></pre></td>
						<td>
							Number of seconds before the cookie expires.
						</td>
					</tr>
					<tr>
						<th>cookie.path</th>
						<td>string</td>
						<td><pre class="php"><code>'/'</code></pre></td>
						<td>
							Restrict the path that the cookie is available to.
						</td>
					</tr>
					<tr>
						<th>cookie.domain</th>
						<td>string</td>
						<td><pre class="php"><code>null</code></pre></td>
						<td>
							Restrict the domain that the cookie is available to.
						</td>
					</tr>
					<tr>
						<th>cookie.secure</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Only transmit cookies over secure connections.
						</td>
					</tr>
					<tr>
						<th>cookie.http_only</th>
						<td>bool</td>
						<td><pre class="php"><code>false</code></pre></td>
						<td>
							Only transmit cookies over HTTP, disabling Javascript access.
						</td>
					</tr>
					<tr>
						<th>module_paths</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Paths to module directories. Used when adding a module without specifying the location.
						</td>
					</tr>
					<tr>
						<td colspan="4">
							&nbsp;
						</td>
					</tr>
					<tr>
						<th>always_load</th>
						<td>array</td>
						<td colspan="2">
							<strong>Array, containing the items the framework has to load when it initializes:</strong>
						</td>
					</tr>
					<tr>
						<th>always_load.packages</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Which packages to autoload. Specify like so: <strong>array('package')</strong> or <strong>array('package' => PKGPATH.'path/to/package')</strong>. In order for this to work a package path must be set in <em>package_paths</em>
						</td>
					</tr>
					<tr>
						<th>always_load.modules</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Which modules to autoload. Specify like so: <strong>array('package')</strong>. Autoloaded modules are accessible via
							the URL. In order for this to work a module path must be set in <em>module_paths</em>
						</td>
					</tr>
					<tr>
						<th>always_load.classes</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Which classes to autoload and initiate. When you want to autoload a class from a package or module, make sure
							that is autoloaded too!
						</td>
					</tr>
					<tr>
						<th>always_load.config</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Which config files to autoload. Load a config file into a group like so: <strong>array('config')</strong> or
							<strong>array('filename' => 'group')</strong>. If you do not want to load the file into a set the group name to
							<em>null</em>: <strong>array('filename' => null)</strong>.
						</td>
					</tr>
					<tr>
						<th>always_load.language</th>
						<td>array</td>
						<td><pre class="php"><code>array()</code></pre></td>
						<td>
							Which language files to autoload. Load a config file into a group like so: <strong>array('lang')</strong> or
							<strong>array('filename' => 'group')</strong>. If you do not want to load the file into a set the group name to
							<em>null</em>: <strong>array('filename' => null)</strong>.
						</td>
					</tr>
				</tbody>
			</table>

			<p>
				Interacting with config files/settings is done using the <a href="../classes/config.html">Config</a> class.
				Config files can also be generated using <a href="../packages/oil/generate.html#configs">Oil</a>.
			</p>

		</div>

		<footer>
			<p>
				&copy; FuelPHP Development Team 2010-2013 - <a href="http://fuelphp.com">FuelPHP</a> is released under the MIT license.
			</p>
		</footer>
	</div>
</body>
</html>
